Skip to content

fix: count a near-miss usage-reporting opt-out as off - #79

Merged
dmccoystephenson merged 1 commit into
mainfrom
fix/usage-reporting-near-miss-opt-out
Nov 19, 2026
Merged

dmccoystephenson merged 1 commit into
mainfrom
fix/usage-reporting-near-miss-opt-out

Conversation

@dmccoystephenson

Copy link
Copy Markdown
Member

What

NearMissOptOut is added, and UsageReportingService gains a Spring constructor that takes the Environment and passes false as the switch when any property source holds an opt-out under a name Spring does not bind to usage.reporting.enabled:

  • a key naming usage reporting that spells "enabled" another way (usage-reporting.enabled, usageReporting.enabled, usage_reporting.enable, USAGE_REPORTING_ENABLE, ...) whose value is not clearly on;
  • one that spells "disabled" (usage.reporting.disabled, USAGE_REPORTING_DISABLED, ...) whose value is on;
  • a value given to usage reporting itself (usage.reporting=false, USAGE_REPORTING=off) that is not clearly on.

The real switch and its relaxed forms (USAGE_REPORTING_ENABLED) are left to Spring, and TRACE_USAGE_REPORTING (which docker-compose.yml passes through blank) is left to the client. The existing four-argument constructor is kept for callers that build the service by hand.

Why

A real-server repro of a Bukkit plugin showed that an opt-out written under another spelling was not recognised and reporting stayed on. gh-backup had the same blind spot: for example usage-reporting.enabled=false in an application.properties is not usage.reporting.enabled, so it was ignored and the default (true) applied. Reference fix: Dans-Plugins/Medieval-Roleplay-Engine#418

Tests

NearMissOptOutTest was added (near-miss opt-outs in a file and in the environment are off; near-miss names that say on, unrelated *.enabled=false properties and a blank TRACE_USAGE_REPORTING stay on; the real switch is read as before). mvn test: 303 tests, 0 failures, 0 errors, 1 skipped (pre-existing). CHANGELOG and CONFIG.md updated.

🤖 Generated with Claude Code

https://claude.ai/code/session_01LYNeupL3KtraCJoZMADVQE


drafted by Claude on behalf of Daniel Stephenson

Spring binds only usage.reporting.enabled and its relaxed forms, so usage-reporting.enabled=false, usage_reporting.enable=false, usage.reporting.disabled=true, usage.reporting=false or USAGE_REPORTING=off were ignored and reporting stayed on. Each now counts as off.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LYNeupL3KtraCJoZMADVQE
@dmccoystephenson
dmccoystephenson merged commit 8e4edc5 into main Nov 19, 2026
2 checks passed
@dmccoystephenson
dmccoystephenson deleted the fix/usage-reporting-near-miss-opt-out branch November 19, 2026 14:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant